import axios from '@/utils/request'

// 加入购物车
const addCart = (params = {}) => {
  return axios.post('/shopping-cart/add', params)
}
// 读取购物车数据
const getCartInfo = (params = {}) => {
  return axios.get('/shopping-cart/info', {params})
}
// 修改购物车商品购买数量
const changeCartNum = (params = {}) => {
  return axios.post('/shopping-cart/modifyNumber', params)
}
// 删除购物车商品
const delCartItem = (params = {}) => {
  return axios.post('/shopping-cart/remove', params)
}
// 修改购物车商品选中状态
const changeItemSelected = (params = {}) => {
  return axios.post('/shopping-cart/select', params)
}

export {
  addCart,
  getCartInfo,
  changeCartNum,
  delCartItem,
  changeItemSelected
}